<!DOCTYPE html>
<html>
<head>
    <title>会员管理:用户管理</title>
    #parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak>
	<div v-show="showList">
        <Row :gutter="16">
            <div class="search-group">
                <i-col span="2">
                    <i-input v-model="q.id" @on-enter="query" placeholder="用户编号" />
                </i-col>
                <i-col span="2">
                    <i-input v-model="q.name" @on-enter="query" placeholder="会员名称"/>
                </i-col>
                <i-col span="2">
                    <i-input v-model="q.mobile" @on-enter="query" placeholder="手机号"/>
                </i-col>
                <i-col span="2">
                    <i-select v-model="q.done" placeholder="会员类型" filterable>
                        <i-option :value="0" >普通会员</i-option>
                        <i-option :value="1" >D-one</i-option>
                        <i-option :value="2" >变异D-one</i-option>
                    </i-select>
                </i-col>
                <i-col span="2">
                    <i-select v-model="q.status" placeholder="是否冻结" filterable>
                        <i-option :value="0" >冻结</i-option>
                        <i-option :value="1" >没冻结</i-option>
                    </i-select>
                </i-col>
                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
            <div class="buttons-group">
                #if($shiro.hasPermission("user:info"))
                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;查看</i-button>
                #end
                #if($shiro.hasPermission("user:save"))
                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
                #end
                #if($shiro.hasPermission("user:update"))
                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>修改</i-button>&nbsp;
                <i-button type="primary" @click="recharge"><i class="fa fa-cc-visa"></i>Done变更</i-button>
                #end
                #if($shiro.hasPermission("user:clear"))
                <i-button type="error" @click="clear"><i class="fa fa-trash-o"></i>清缓存</i-button>&nbsp;
                #end
                #if($shiro.hasPermission("user:delete"))
                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>删除</i-button>&nbsp;
                <i-button type="error" @click="delData"><i class="fa fa-trash-o"></i>删除数据</i-button>
                #end
                #if($shiro.hasPermission("user:export"))
                <i-button type="warning" @click="exportPro"><i class="fa fa-pencil-square-o"></i>导出</i-button>
                #end
            </div>
        </Row>
	    <table id="jqGrid"></table>
	    <div id="jqGridPager"></div>
    </div>

    <Card v-show="!showList">
        <p slot="title">{{title}}</p>
        <i-form ref="formValidate" :model="user" :rules="ruleValidate" :label-width="100">
            <Form-item label="编号" prop="id">
                <i-input v-model="user.id" placeholder="id" readonly/>
            </Form-item>
            <Form-item label="姓名" prop="name">
                <i-input v-model="user.name" placeholder="姓名"/>
            </Form-item>
            <Form-item label="真实姓名" prop="realName">
                <i-input v-model="user.realName" placeholder="真实姓名"/>
            </Form-item>
            <Form-item label="手机" prop="mobile">
                <i-input v-model="user.mobile" placeholder="手机"/>
            </Form-item>
            <Row>
                <i-col span="16">
                    <Form-item label="头像" prop="pictureUrl">
                        <i-input v-model="user.pictureUrl" placeholder="头像" readonly/>
                    </Form-item>
                </i-col>
                <i-col span="3">
                    <Form-item :label-width="1">
                        <Upload style="width: 300px;" action="../sys/oss/upload?prefix=logo" :format="['jpg','jpeg','png']"
                                max-size="2048"
                                :on-success="handleSuccessImg" :on-format-error="handleFormatError"
                                :show-upload-list="false"
                                :on-exceeded-size="handleMaxSize">
                            <i-button icon="ios-cloud-upload-outline">上传图片</i-button>
                        </Upload>
                    </Form-item>
                </i-col>
                <i-col span="3">
                    <Form-item :label-width="1">
                        <i-button icon="eye" @click="eyeImageImg">预览图片</i-button>
                    </Form-item>
                </i-col>
            </Row>
            <Form-item label="是否冻结" prop="status">
                <Radio-group v-model="user.status">
                    <Radio label="0">
                        <span>冻结</span>
                    </Radio>
                    <Radio label="1">
                        <span>启用</span>
                    </Radio>
                </Radio-group>
            </Form-item>
            <Form-item label="冻结原因" prop="remark">
                <i-input v-model="user.remark" placeholder="冻结原因"/>
            </Form-item>
            <Form-item label="性别" prop="gender">
                <Radio-group v-model="user.gender">
                    <Radio label="0">
                        <span>男</span>
                    </Radio>
                    <Radio label="1">
                        <span>女</span>
                    </Radio>
                </Radio-group>
            </Form-item>

            <Form-item label="风险级别" prop="danger">
                <i-input v-model="user.danger" placeholder="风险级别123数越大风险越高"/>
            </Form-item>
            <Form-item label="级别" prop="level">
                <i-input v-model="user.level" placeholder="级别1，3，6，10"/>
            </Form-item>
            <Form-item label="个性签名" prop="signature">
                <i-input v-model="user.signature" placeholder="个性签名"/>
            </Form-item>
            <Form-item label="微信id" prop="wxUnionId">
            <i-input v-model="user.wxUnionId" placeholder="微信id"/>
            </Form-item>
            <Form-item label="地址" prop="address">
                <i-input v-model="user.address" placeholder="地址"/>
            </Form-item>
            <Form-item label="会员类型" prop="isdOne">
                <Radio-group v-model="user.isdOne"  placeholder="会员类型">
                    <Radio label="0">
                        <span>普通会员</span>
                    </Radio>
                    <Radio label="1">
                        <span>D-one</span>
                    </Radio>
                    <Radio label="2">
                        <span>变异D-one</span>
                    </Radio>
                </Radio-group>
            </Form-item>
            <Form-item label="邀请是否已返" prop="invite">
                <Radio-group v-model="user.invite"  placeholder="邀请是否已返">
                    <Radio label="0">
                        <span>未返</span>
                    </Radio>
                    <Radio label="1">
                        <span>已返</span>
                    </Radio>
                </Radio-group>
            </Form-item>

            <Row>
                <i-col span="16">
                    <Form-item label="用户背景" prop="bgimg">
                        <i-input v-model="user.bgimg" placeholder="用户背景" readonly/>
                    </Form-item>
                </i-col>
                <i-col span="3">
                    <Form-item :label-width="1">
                        <Upload style="width: 300px;" action="../sys/oss/upload?prefix=background" :format="['jpg','jpeg','png']"
                                max-size="2048"
                                :on-success="handleSuccessBg" :on-format-error="handleFormatError"
                                :show-upload-list="false"
                                :on-exceeded-size="handleMaxSize">
                            <i-button icon="ios-cloud-upload-outline">上传图片</i-button>
                        </Upload>
                    </Form-item>
                </i-col>
                <i-col span="3">
                    <Form-item :label-width="1">
                        <i-button icon="eye" @click="eyeImageBg">预览图片</i-button>
                    </Form-item>
                </i-col>
            </Row>
            <Form-item>
                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button>
                <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
            </Form-item>
        </i-form>
    </Card>
    <Card v-show="!showDelData">
        <p slot="title">{{title}}</p>
        <i-form ref="formValidate" :model="q" :label-width="80">
            <Form-item label="用户编号" prop="uid">
                <i-input v-model="q.uid" placeholder="用户编号"/>
            </Form-item>
            <Form-item>
                <i-button type="primary" @click="handleSubmitDel('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button>
                <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
            </Form-item>
        </i-form>
    </Card>
</div>

<script src="${rc.contextPath}/js/partner/partner.js?_${date.systemTime}"></script>
</body>
</html>